package com.kevin.service.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.alibaba.excel.enums.BooleanEnum;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.util.Date;

/**
 * sysloglogin 实体类
 *
 * @author makejava
 * @date 2023-04-06
 */
@TableName(value = "sys_log_login")
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER)
public class SysLogLogin {

    /**
     * id
     */
    @ExcelIgnore
    @TableId
    @ApiModelProperty(value = "主键")
    private Long id;

    /** 用户名 */
    @HeadFontStyle(bold = BooleanEnum.FALSE, fontHeightInPoints = 12)
    @ColumnWidth(15)
    @ExcelProperty(value = "用户名", order = 1)
    @ApiModelProperty(value = "用户名")
    @TableField("username")
    private String username;

    /** 登录IP */
    @HeadFontStyle(bold = BooleanEnum.FALSE, fontHeightInPoints = 12)
    @ColumnWidth(15)
    @ExcelProperty(value = "登录IP", order = 2)
    @ApiModelProperty(value = "登录IP")
    @TableField("ip")
    private String ip;

    /** 登录地点 */
    @HeadFontStyle(bold = BooleanEnum.FALSE, fontHeightInPoints = 12)
    @ColumnWidth(20)
    @ExcelProperty(value = "登录地点", order = 3)
    @ApiModelProperty(value = "登录地点")
    @TableField("address")
    private String address;

    /** User Agent */
    @HeadFontStyle(bold = BooleanEnum.FALSE, fontHeightInPoints = 12)
    @ColumnWidth(100)
    @ExcelProperty(value = "User Agent", order = 4)
    @ApiModelProperty(value = "User Agent")
    @TableField("user_agent")
    private String userAgent;

    /** 登录状态  0：失败   1：成功 */
    @ExcelIgnore
    @ApiModelProperty(value = "登录状态  0：失败   1：成功")
    @TableField("status")
    private Integer status;

    @ExcelIgnore
    /** 操作信息   0：登录成功   1：退出成功  2：验证码错误  3：账号密码错误 */
    @ApiModelProperty(value = "操作信息   0：登录成功   1：退出成功  2：验证码错误  3：账号密码错误")
    @TableField("operation")
    private Integer operation;

    /**
     * 创建时间
     */
    @ExcelIgnore
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @HeadFontStyle(bold = BooleanEnum.FALSE, fontHeightInPoints = 12)
    @ColumnWidth(15)
    @ExcelProperty(value = "登录状态", order = 5)
    @TableField(exist = false)
    private String statusStr;

    @HeadFontStyle(bold = BooleanEnum.FALSE, fontHeightInPoints = 12)
    @ColumnWidth(15)
    @ExcelProperty(value = "创建时间", order = 6)
    @TableField(exist = false)
    private String createTimeStr;
}

